using Pegasus;
using System;

namespace Pegasus.Threading
{
	/// <summary>
	/// Summary description for IScheduleTask.
	/// </summary>
	public interface IScheduleTask
	{
		/// <summary>
		/// Gets the name of the task.
		/// </summary>
		/// <value>The name of the task.</value>
		string Name
		{
			get;
		}

		/// <summary>
		/// Gets a value indicating whether this is a reoccurring task or not.
		/// </summary>
		/// <value>
		/// If <c>true</c> the task will be reschedule after is runs.  If <c>false</c> then the
		/// task will only be executed once.
		/// </value>
		bool ReoccurringTask
		{
			get;
		}

		/// <summary>
		/// Gets the next date and time of the next occurrence of the task.
		/// </summary>
		/// <returns>The next occurrence of the task.</returns>
		DateTime GetNextReoccurrence();

		/// <summary>
		/// Called to execute the task.
		/// </summary>
		void RunTask();
	}
}
